<template>
  <!-- 随便点击某个地方发送礼物 -->
  <div>
    <gift-animate :list.sync="giftList" />
  </div>
</template>

<script>
import GiftAnimate from '@/components/gift-animate'
export default {
  components: {
    GiftAnimate
  },
  data () {
    return {
      /* giftList: Array.from({ length: 0 }).map((item, index) => {
        return {
          uid: index + 1,
          amount: parseInt(1 + index + Math.random() * 100),
          username: `用户${index + 1}`,
          src: 'https://nowpic.gtimg.com/hy_personal/4376ae1e0cf0cccea115be495dd11ee1ba6b37639ee833ed36b0d3a0710cd3f7dc7ca65dbadd5459883cc3c40c1be640/80?tp=webp'
        }
      }) */
      giftList: []
    }
  },
  mounted () {
    document.body.addEventListener('click', () => {
      const index = parseInt(Math.random() * 5) + 1
      this.giftList.push({
        uid: index,
        amount: index,
        username: `用户${index}`,
        // src: `liwu/liwu${index}.png`
        src: 'https://nowpic.gtimg.com/hy_personal/4376ae1e0cf0cccea115be495dd11ee1ba6b37639ee833ed36b0d3a0710cd3f7dc7ca65dbadd5459883cc3c40c1be640/80?tp=webp'
      })
    })
  }
}
</script>
<style  lang="scss" scoped>

</style>
